with open("diary.txt","w",encoding="UTF-8") as f:
   f.write("2023-10-01 晴\n今天学习了文件操作")
   f.flush()
   print("日记写入完成")

